#include "game.h"
#include "level.h"

Game::Game()
{
	app.Create(sf::VideoMode(GameSettings::WindowWidth, GameSettings::WindowHeight), "Roguelike", sf::Style::Close);
	app.SetFramerateLimit(GameSettings::GameFPSMax);

	running = true;
}

void Game::gameLoop()
{
	while (running)
	{
		coreLogic();
		renderScene();
	}
}

void Game::coreLogic()
{
	while(app.GetEvent(event))
	{
		if (event.Type == sf::Event::Closed)
		{
			running = false;
		}
	}
}

// TEMPORARY //
Level lvl(sf::Vector2<float>(128, 128), sf::Vector2<float>(GameSettings::TileMaxX/2, GameSettings::TileMaxY/2));
void Game::renderScene()
{
	app.Clear();

	lvl.draw(app);	// TEMPORARY //

	app.Display();
}